#include "EnemyBullet.h"


EnemyBullet::EnemyBullet() :m_isRelease(false), m_bullet(NULL)
{
}

EnemyBullet::~EnemyBullet()
{
	if (m_bullet)
	{
		m_bullet->release();
	}
}

bool EnemyBullet::init()
{
	if (!CCNode::init())
	{
		return false;
	}
	this->setAnchorPoint(ccp(0.5, 0.5));
	CCSpriteFrame* frame = CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName("enemy19_1.png");
	m_bullet = CCSprite::createWithSpriteFrame(frame);
	CCSize size = m_bullet->getContentSize();

	this->setContentSize(CCSizeMake(size.width/2,size.height/2));
	m_bullet->setPosition(ccp(size.width * 0.8f, size.height*0.8f));
	this->addChild(m_bullet);
	m_bullet->retain();
	m_bullet->setScale(0.8);
	return true;
}